<?php

namespace Schivei\Models;

/**
 * Description of Usuario
 *
 * @author elton.schivei
 */
class Usuario extends \System\Core\Model
{

    public function __construct()
    {
        parent::__construct();

        //$class = new \System\Types\String(\Schivei\Entities\Usuarios\Usuario::GetName());
        //$ref = new \System\Types\Reflections\ReflectionAssembly($class);
        //$this->map = new \System\Data\Mapped($ref);
    }

    /**
     * @param \System\Types\Integer $id
     * @return \Schivei\Entities\Usuarios\Usuario
     */
    public function GetById(\System\Types\Integer $id)
    {
        $sql = new \System\Types\String("SELECT * FROM usuario WHERE id = {0}");

        $result = $this->db->Run($sql, array($id));

        return (!\is_bool($result)) ? $result->FetchUnique(0, \System\Data\IDataResult::FETCH_OBJECT, \Schivei\Entities\Usuarios\Usuario::GetTheName(), array()) : $result;
    }

}
